package com.suzus.eight;

import com.rabbitmq.client.BuiltinExchangeType;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.DeliverCallback;
import com.suzus.utils.RabbitMqUtils;

import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;

public class Consumer02 {

    public static final String DEAD_QUEUE="dead_queue";


    public static void main(String[] args) throws Exception {

        Channel channel = RabbitMqUtils.getChannel();

        System.out.println("waiting information");

        DeliverCallback deliverCallback = (var1,var2)->{
            System.out.println("C2: "+new String(var2.getBody(), StandardCharsets.UTF_8));
        };

        channel.basicConsume(DEAD_QUEUE,true, deliverCallback,consumerTag->{});

    }
}
